import { Typography } from "antd";

// 类型守卫
const isError = (error: any): error is Error => error?.message;
interface Props {
  error: unknown;
}
export const ErrorBox = ({ error }: Props) => {
  if (isError(error))
    return <Typography.Text type="danger">{error.message}</Typography.Text>;
  return null;
};
